import request from '@/utils/http'
import { BaseResult, TravelResult } from '@/types/axios'
import { Rows } from '@/api/model/travelModel'

export class TravelService {
  //获取自身差旅列表
  static getTravelList(params: any) {
    return request.post<TravelResult<Rows>>({
      url: '/travel/travelSearch',
      params
    })
  }
  //添加差旅信息
  static addTravel(params: any) {
    console.log(params)
    return request.post<BaseResult>({
      url: '/travel/addTravel',
      params
    })
  }
  //获取差旅详情
  static getTravelDetail(id: number) {
    return request.get<BaseResult>({
      url: `/travel/travelInfo?id=${id}`
    })
  }
  //删除差旅信息
  static delTravel(params: any) {
    return request.post<BaseResult>({
      url: `/travel/removeTravel`,
      params
    })
  }
}
